package main.java.game.item.equipableTreasure;

import main.java.game.Player;
import main.java.game.combatant.Hero;

public class CloakTreasure extends EquipableTreasure {
	
	public CloakTreasure (String name, Integer defenseValue, Integer attackValue, Integer initValue, Integer lpValue, Integer sellingPrice, Integer level){
		super(name, defenseValue, attackValue, initValue, lpValue, sellingPrice, level);
		
	}
	public void equip(Hero hero) {
		if(hero.getCloak()!=null)
			this.unequip(hero);
		
		hero.setInit(hero.getInit()+this.getInitValue());
		hero.setCloak(this);
		hero.getPlayer().setCloak(null);
		

	}

	
	public void unequip(Hero hero) {
		CloakTreasure cloak=hero.getCloak();
		Player player=hero.getPlayer();
		player.setCloak(player.getCloak());
		hero.setInit(hero.getInit()-cloak.getInitValue());
		hero.setCloak(null);

	}


}
